home *** CD-ROM | disk | FTP | other *** search
/ World of Education / World of Education.iso / world_e / eval1.zip / MANUAL.DOC < prev    next >
Text File  |  1992-08-31  |  25KB  |  595 lines

  1.  
  2.           
  3.           
  4.           
  5.                                   EVAL Version 1.0
  6.           
  7.                                       +++++++++
  8.           
  9.                                 by McAdams Associates
  10.           
  11.           
  12.           
  13.           
  14.           *****************************************************************
  15.           
  16.           
  17.                                     **IMPORTANT**
  18.           
  19.                To register Eval, see "Registering Eval" on page 9 of  
  20.                                     this manual.
  21.           
  22.           
  23.           
  24.           Contents                                 Page
  25.           --------                                 ----
  26.           Description................................ 2
  27.           Running Eval............................... 2
  28.           Removing Eval From Memory.................. 2
  29.           Control Keys............................... 3
  30.           Using Eval................................. 4
  31.           Evaluation Order........................... 4
  32.           Inputting Different Number Bases........... 4
  33.           Getting Answers in Different Number Bases.. 5
  34.           Eval's Limits.............................. 6
  35.           Disclaimer & Agreement..................... 8
  36.           Registering Eval........................... 9
  37.           Index......................................10
  38.           
  39.           
  40.           
  41.           
  42.           
  43.           
  44.           
  45.           
  46.           
  47.           
  48.           
  49.           
  50.           
  51.           
  52.           
  53.           
  54.           
  55.               (C)Copyright 1992 by T.C. McAdams.  All Rights Reserved.
  56.           DESCRIPTION
  57.           -----------
  58.           
  59.           EVAL.EXE is a pop-up TSR expression evaluator and number base 
  60.           conversion program.  EVAL can act as both a four-function 
  61.           floating point calculator and as a programmer's number base 
  62.           converter, translating numbers to and from binary, octal, decimal 
  63.           and hexadecimal number bases.  EVAL is completely modeless in its 
  64.           operation and dispenses entirely with the conventional 
  65.           "pushbutton" calculator paradigm.  Because of this you are 
  66.           encouraged to read this manual to get the most out of EVAL.  EVAL 
  67.           should work in any 80- or 40-column text mode on any DOS computer 
  68.           running DOS 2.1 or above.
  69.           
  70.           RUNNING EVAL
  71.           ------------
  72.           
  73.           EVAL can be run as a standalone program by typing
  74.           
  75.                EVAL [ENTER]
  76.           
  77.           at the DOS command line.  All of the program's abilities, except 
  78.           for the ability to output a result to the running application, 
  79.           are available in this mode.
  80.           
  81.           EVAL can be made memory resident by typing
  82.           
  83.                EVAL /r [ENTER]
  84.           
  85.           at the command line.  Equally valid would be /R, -r or -R.  The 
  86.           "R" stands for "resident".
  87.           
  88.           When the program has been successfully loaded into memory and 
  89.           made resident, it will beep once.  This is EVAL's way of saying 
  90.           everything is fine.  If you hear TWO beeps, it means that EVAL is 
  91.           unable to make itself resident in memory.  The main reason for 
  92.           this to occur is that a copy of EVAL is already resident.  EVAL 
  93.           is programmed to "check for itself" before loading to keep from 
  94.           using more memory than necessary.
  95.           
  96.           REMOVING EVAL FROM MEMORY
  97.           -------------------------
  98.           
  99.           When it is memory resident, EVAL can be removed from memory by 
  100.           typing
  101.           
  102.                EVAL /k [ENTER]
  103.           
  104.           where /K, -k and -K are all acceptable.  The "K" means "kill from 
  105.           memory".  If EVAL successfully removes itself from memory you'll 
  106.           hear one beep.  If the program is unable to remove itself you 
  107.           will hear TWO beeps.  Possible reasons for this are 1) the 
  108.           program was not resident to begin with, 2) a program was loaded 
  109.           after EVAL that altered one or more of the interrupts EVAL uses, 
  110.           making it impossible to safely change them back to their original 
  111.           
  112.           
  113.           
  114.           
  115.                                           2
  116.           values.  If this happens, the only way to remove EVAL from memory 
  117.           is to reboot.
  118.           
  119.           CONTROL KEYS
  120.           ------------
  121.           
  122.           If EVAL is memory-resident, the program is invoked by pressing 
  123.           [CTRL + SPACE].  This means hold down the [CTRL] key while 
  124.           pressing [SPACE].  The basic control keys will be seen displayed 
  125.           on the bottom line of the program box: [ESC]Quit [-><-] 
  126.           [Backspace] [Delete] [Insert].  These keys (except [ESC]) control 
  127.           the movement of the block cursor visible on the input/answer line 
  128.           in the middle of the program box.  Here's what the keys do:
  129.           
  130.           [ESC]       leaves EVAL.
  131.           
  132.           [-><-]      The arrow keys move the cursor to the left and right 
  133.                       within an expression, without erasing any character 
  134.                       it moves over.
  135.           
  136.           [Backspace] erases the character to the cursor's immediate left 
  137.                       and moves the remainder of the expression (anything 
  138.                       to the right of the cursor) left.
  139.           
  140.           [Delete]    erases the character under the cursor.
  141.           
  142.           [Insert]    controls the input mode.  Insert mode is the default, 
  143.                       and is shown by the short block cursor.  If the 
  144.                       cursor is moved inside an expression and a key 
  145.           is struck in insert mode, that character is inserted into the 
  146.           string and all characters to the right are moved one space right.  
  147.           Pressing the insert key shifts the mode to overstrike and causes 
  148.           the cursor to change appearance (a large block cursor).  Typing 
  149.           inside an expression in overstrike mode causes the newly typed 
  150.           characters to replace whatever was there previously.  The Insert 
  151.           key in EVAL operates identically to most text editors.
  152.           
  153.           [ENTER]     to obtain an answer.
  154.           
  155.           [CTRL + SPACE]  From inside EVAL, when memory resident, "pops 
  156.                       down" the program box and feeds the latest result 
  157.                       into the running application.
  158.                       
  159.           Not shown on-screen, but always available during input, are the 
  160.           [Home] and [End] keys.  Pressing [Home] moves the cursor to the 
  161.           beginning of an expression.  [End] moves the cursor to the end of 
  162.           an expression.
  163.           
  164.           After [ENTER] has been pressed, a new set of control keys appears 
  165.           in the rectangle: [F1]Expression [F2]Accum. [F3]Clear.
  166.           
  167.           [F1]        redisplays the original expression.
  168.           
  169.           
  170.  
  171.           
  172.           
  173.           
  174.           
  175.                                           3
  176.           [F2]        uses the answer to the last expression as the first 
  177.                       number of the new.
  178.           
  179.           [F3]        clears everything.
  180.           
  181.           USING EVAL
  182.           ----------
  183.           
  184.           EVAL is a four-function expression evaluator.  What this means is 
  185.           that instead of merely pushing buttons, you can instead type 
  186.           things like
  187.           
  188.                -(32.5+19.5)/16*9.7 [ENTER]
  189.           
  190.           and get as a result -0.335051546391753.
  191.           
  192.           EVALUATION ORDER
  193.           ----------------
  194.           
  195.           To get the results you expect from a calculation, you should know 
  196.           how EVAL evaluates an expression string.  EVAL evaluates from 
  197.           left to right, within parentheses, in operator order.  Operators 
  198.           are always evaluated as follows:
  199.           
  200.           Precedence  Operator   Action
  201.           -------------------------------------
  202.           1              *       multiplication
  203.           2              /       division
  204.           3              +       addition
  205.           4              -       subtraction
  206.           
  207.           In the above example, for instance, the sub-expression
  208.           
  209.                -(32.5+19.5)
  210.           
  211.           is first to be evaluated, since it is inside parentheses.  When 
  212.           this is done, the overall expression then looks like
  213.           
  214.                -52/16*9.7
  215.           
  216.           Next, the 16*9.7 is evaluated (multiplication is done first), 
  217.           leaving us with
  218.           
  219.                -52/155.2
  220.           
  221.           which is then evaluated to give the result -0.335051546391753.
  222.           
  223.           INPUTTING DIFFERENT NUMBER BASES
  224.           --------------------------------
  225.           
  226.           The previous example was entirely decimal, or base ten.  What 
  227.           would happen if we typed
  228.           
  229.                0xfe57 * 0b110 + 098 * .36 [ENTER] ?
  230.  
  231.           
  232.           
  233.           
  234.           
  235.                                           4
  236.           We would get 390666, of course!  To explain, the following number 
  237.           prefixes are what are used to denote different number bases in 
  238.           EVAL:
  239.           
  240.           Prefix         Number base
  241.           ------------------------------------------------------
  242.           0b (zero-"b")  binary (base 2)
  243.           0  (zero)      octal (base 8)
  244.           d              decimal (base 10)      
  245.           <nothing>      decimal (base 10, default, same as "d")
  246.           0x (zero-"x")  hexadecimal (base 16)
  247.           
  248.           Upper- or lower-case doesn't matter: "0B" is the same as "0b" and 
  249.           "0X" is equivalent to "0x".  Note that where zeros are used in a 
  250.           prefix they must ALWAYS be zeros; letter O's won't work.
  251.           
  252.           The programmers among you will already have noticed that all of 
  253.           the prefixes except that for binary are standard C-language 
  254.           syntax.  That's no accident, since EVAL was written in C.  Since 
  255.           C doesn't support binary numbers, however, a prefix had to be 
  256.           invented, which I did with the "0b".
  257.           
  258.           Note: When a result is output to the running application by 
  259.           pressing [CTRL + SPACE] all number prefixes are stripped off.
  260.           
  261.           GETTING ANSWERS IN DIFFERENT NUMBER BASES
  262.           -----------------------------------------  
  263.           
  264.           The number prefixes explained above are for individual numbers.  
  265.           So as not to confuse EVAL, a different method has to be used to 
  266.           indicate the output, or overall expression, number base.  Instead 
  267.           of number prefixes, then, we use expression prefixes, which are 
  268.           letters at the beginning of an expression.
  269.           
  270.           The following expression prefixes are used:
  271.           
  272.           Prefix         Output
  273.           ---------------------------
  274.           b              binary
  275.           o              octal
  276.           d              decimal (default)
  277.           h              hexadecimal
  278.           
  279.           As before, upper- or lower-case doesn't matter.
  280.           
  281.           The expression prefix "d" (for decimal) is provided for 
  282.           consistency, but isn't really necessary since decimal output is 
  283.           EVAL's default mode.
  284.           
  285.           Time for some examples.  Typing
  286.           
  287.                B255 [ENTER]
  288.           
  289.           
  290.  
  291.           
  292.           
  293.           
  294.           
  295.                                           5
  296.           produces 0b11111111, which is 255 in binary (base 2).  Typing
  297.           
  298.                h255 [ENTER]
  299.           
  300.           produces 0xff, which is 255 in hexadecimal.  And so on, with any 
  301.           of the expression prefixes shown above.  To get fancier, we can 
  302.           combine number and expression prefixes in lots of different ways:
  303.            
  304.                b0x214*03777+0b11110000 [ENTER]
  305.           
  306.           which gives us an answer of 0b100001001111011011100.  See how it 
  307.           works: The first character of the expression, "b",  is the 
  308.           overall expression prefix, specifying binary output.  The first 
  309.           number of the expression has the hexadecimal number prefix "0x", 
  310.           the second number the octal "0" prefix and the third number the 
  311.           binary "0b" prefix.
  312.           
  313.           To see how easy things are to change, type the previous example 
  314.           into EVAL and press [ENTER].  Then press [F1] (to bring back the 
  315.           original expression), [Home] (to move the cursor to the beginning 
  316.           of the expression), and [Delete] (to delete the binary expression 
  317.           prefix, placing us back into default decimal output mode).  
  318.           Hitting [ENTER] again gives us the decimal result 1089244.  
  319.           Repeating the process, but this time putting an "O" (letter "O", 
  320.           for octal, this time, not zero) expression prefix at the start of 
  321.           the expression, gives us the base 8 answer of 04117334.
  322.           
  323.           The main thing to remember, when using EVAL to convert numbers to 
  324.           and from various number bases, is the idea of NUMBER PREFIXES and 
  325.           EXPRESSION PREFIXES.  Number prefixes govern how a number is 
  326.           interpreted.  Expression prefixes determine how an answer is 
  327.           output.
  328.           
  329.           EVAL'S LIMITS
  330.           -------------
  331.           
  332.           The following is a table of the maximum and minimum values EVAL 
  333.           will handle:
  334.           
  335.           Mode           Maximum                Minimum
  336.           --------------------------------------------------------------
  337.           Binary         8589934591             -4294967295   
  338.           Octal          5.070602400912918e+030 -6.338253001141147e+029 
  339.           Decimal        1.7e+308               -1.7e+308
  340.           <fractions>    1.7e-307               -1.7e-307
  341.           Hex            5.444517870735015e+039 -3.402823669209385e+038
  342.           
  343.           When these limits are exceeded an overflow or underflow error 
  344.           occurs.  When this happens, press [F1] to edit the original 
  345.           expression, or [F3] to clear the program box.  When decimal 
  346.           numbers become greater than 999999999999999, or smaller than 
  347.           -999999999999999, EVAL switches automatically to exponential 
  348.           format where, for example, 1.7e+308 means the decimal point 
  349.           should be moved 308 places to the right, and 1.7e-30 means the 
  350.           decimal point should be moved 30 places left.
  351.           
  352.           
  353.           
  354.           
  355.                                           6
  356.           
  357.           Decimal (base 10) is the only number base in which fractional 
  358.           numbers are handled.  Inputting something like 0xff.f3 would 
  359.           result in an answer of 255; everything after the decimal point 
  360.           will be ignored.
  361.           
  362.           EVAL's error checking is minimal, so care should be taken not to 
  363.           input a number too large for the number base specified by the 
  364.           expression prefix.  To show what this means, if you input 01238 
  365.           [ENTER], the answer would be 83.  Silly number!  To see why, 
  366.           input 08 [ENTER].  The answer is zero, since the octal number 
  367.           base is comprised only of numerals from 0 through 7, and EVAL 
  368.           quits parsing (breaking down) a number when the numeral it's 
  369.           looking at exceeds a number's base.
  370.           
  371.           To make things clearer, here are all possible numerals in each 
  372.           number base:
  373.           
  374.           Base           Possible numbers
  375.           -------------------------------------------------------------
  376.           2              0, 1
  377.           8              0, 1, 2, 3, 4, 5, 6, 7
  378.           10             0, 1, 2, 3, 4, 5, 6, 7, 8, 9
  379.           16             0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
  380.           
  381.           In base 16, "number" A is the same as 10 decimal, B represents 
  382.           11, and so on through F = 15.  
  383.           
  384.           Inputting e5 [ENTER] (without a hex number prefix) would come out 
  385.           as 5, since the "e" is skipped when EVAL is "building" a number.  
  386.           Remember that all nondecimal number bases have a "0" as the first 
  387.           character of their number prefixes.  Since EVAL takes "e5" to be 
  388.           decimal, the "e" is simply passed over, much as a space would be. 
  389.           Generally speaking, assume that if you input nonexistent numbers, 
  390.           or nondecimal numbers without the necessary number prefix, you 
  391.           will get silly answers in return.
  392.           
  393.           Note for programmers:  Since EVAL uses the Microsoft floating 
  394.           point math library, bitwise operations aren't possible.  Bitwise 
  395.           shifting can be simulated, however, by multiplying and dividing 
  396.           by powers of two:
  397.           
  398.           Places shifted           Number to multiply/divide by
  399.           -----------------------------------------------------
  400.           1                        2
  401.           2                        4
  402.           3                        8
  403.           4                        16
  404.           5                        32
  405.           6                        64
  406.           7                        128
  407.           8                        256
  408.  
  409.  
  410.  
  411.           
  412.           
  413.           
  414.           
  415.                                           7
  416.           DISCLAIMER & AGREEMENT
  417.           ----------------------
  418.           
  419.           Users of EVAL must accept this disclaimer of warranty:
  420.           
  421.           "EVAL is supplied as is.  The author disclaims all warranties, 
  422.           expressed or implied, including, without limitation, the 
  423.           warranties of merchantability and of fitness for any purpose.
  424.           The author assumes no liability for damages, direct or conse-
  425.           quential, which may result from the use of EVAL."
  426.           
  427.           EVAL is a "shareware program" and is provided at no charge
  428.           to the user for evaluation.  Feel free to share it with your
  429.           friends, but please do not give it away altered or as part of
  430.           another system.  The essence of "user-supported" software is to
  431.           provide personal computer users with quality software without
  432.           high prices, and yet to provide incentive for programmers to
  433.           continue to develop new products.  If you find this program
  434.           useful and find that you are using EVAL and continue to use
  435.           EVAL after a reasonable trial period, you must make a reg-
  436.           istration payment of $15 to McAdams Associates.  The $15
  437.           registration fee will license one copy for use on any one
  438.           computer at any one time.  You must treat this software just like
  439.           a book.  An example is that this software may be used by any
  440.           number of people and may be freely moved from one computer
  441.           location to another, so long as there is no possibility of it
  442.           being used at one location while it's being used at another.
  443.           Just as a book cannot be read by two different persons at the
  444.           same time.
  445.           
  446.           Commercial users of EVAL must register and pay for their
  447.           copies of EVAL within 30 days of first use or their license
  448.           is withdrawn.  Site-License arrangements may be made by con-
  449.           tacting McAdams Associates.
  450.           
  451.           Anyone distributing EVAL for any kind of remuneration must
  452.           first contact McAdams Associates at the address below for 
  453.           authorization.  This authorization will be automatically granted 
  454.           to distributors recognized by the ASP as adhering to its 
  455.           guidelines for shareware distributors, and such distributors may 
  456.           begin offering EVAL immediately (However McAdams Associates must 
  457.           still be advised so that the distributor can be kept up-to-date 
  458.           with the latest version of EVAL.).
  459.           
  460.           You are encouraged to pass a copy of EVAL along to your
  461.           friends for evaluation.  Please encourage them to register their
  462.           copy if they find that they can use it.
  463.           
  464.           Since this is shareware and I am a member of the Association of 
  465.           Shareware Professionals, please read the following:
  466.           
  467.                "This program is produced by a member of the 
  468.                Association of Shareware Professionals (ASP).  ASP 
  469.                wants to make sure that the shareware principle works 
  470.                for you. If you are unable to resolve a shareware-
  471.           
  472.           
  473.           
  474.           
  475.                                           8
  476.                related problem with an ASP member by contacting the 
  477.                member directly, ASP may be able to help. The ASP 
  478.                Ombudsman can help you resolve a dispute or problem 
  479.                with an ASP member, but does not provide technical 
  480.                support for members' products. Please write to the ASP 
  481.                Ombudsman at 545 Grover Road, Muskegon, MI 49442
  482.                or send a CompuServe message via CompuServe Mail to ASP 
  483.                Ombudsman 70007,3536."
  484.                
  485.           REGISTERING EVAL
  486.           ----------------
  487.           
  488.           Registering EVAL costs $15 and includes one year's free support 
  489.           by phone, mail and CompuServe e-mail, free bug fixes, the latest 
  490.           version of EVAL, plus a handy disk utility program: TO/RET, a 
  491.           "two-in-one" combo that work together, enabling you to change to 
  492.           any disk/directory and return instantly to your starting point.
  493.           
  494.           To register EVAL, simply print and fill out the file REGISTER.DOC 
  495.           and send it, along with $15 (checks or M.O.s drawn on a U.S. bank 
  496.           only, please) to:
  497.           
  498.                                  McAdams Associates
  499.                                   P.O. Box 835505 
  500.                              Richardson, TX  75083-5505
  501.           
  502.                                  CIS PPN 70353,1644
  503.           
  504.           
  505.           -----------------------------------------------------------------
  506.           
  507.           
  508.           EVAL was created using QuickC and MASM, which are trademarks of 
  509.           Microsoft Corporation.
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.           
  532.           
  533.           
  534.           
  535.                                           9
  536.           INDEX
  537.           -----
  538.           
  539.           
  540.           
  541.           [-><-] arrow keys, 3
  542.           Accumulator, see [F2]
  543.           Answers in different bases, 5
  544.           Beeps
  545.                one, signifying success, 2
  546.                two, signifying failure, 2
  547.           Bit-shifting (simulating), 7
  548.           Clearing the program box, see [F3]
  549.           Control keys, 3
  550.           [CTRL + SPACE] key
  551.                from inside EVAL, 3
  552.                initial hotkey, 3
  553.           [DELETE] key, 3
  554.           Description, 2
  555.           Editing an expression, see Control keys
  556.           [END] key, 3
  557.           [ENTER] key, 3
  558.           Errors
  559.                number base, 7
  560.                overflow, 6
  561.                underflow, 6
  562.           [ESC] key, 3
  563.           EVAL compatibility, 2
  564.           EVAL's limits, 6-7
  565.           Evaluation order, 4
  566.           Expression prefixes, 5-6
  567.           [F1] key, 3
  568.           [F2] key, 4
  569.           [F3] key, 4
  570.           Getting an answer, see [ENTER]
  571.           [HOME] key, 3
  572.           Hotkey (for popping up), see [CTRL + SPACE]
  573.           Inputting a number/expression, 4
  574.           [INSERT] key, 3
  575.           Legal stuff, 8
  576.           Number prefixes, 5
  577.           Numerals (all possible), 7
  578.           Operator precedence, 4
  579.           Recalling original expression, see [F1]
  580.           Registering EVAL, 9
  581.           Running EVAL
  582.                from the command line, 2
  583.                when memory resident, 2
  584.           Using EVAL, 4
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.           
  592.           
  593.           
  594.           
  595.                                          10